Repository navigation
fix(mcpx): reject invalid /v1/interactions score bounds with 400 (#2223) - #3081
Merged
Merged
Conversation
A non-numeric minScore/maxScore was silently dropped (200, unfiltered list); NaN/Inf parsed successfully and reached SQLite as NULL (200, empty list). Both read as real answers on the feedback-review surface. The handler now 400s naming the parameter on a parse error or non-finite value; finite bounds are unchanged. The same silent-drop shape in limit/offset gets the same 400 rule (triage pin, task 3372). Handler tests cover abc/NaN/Inf/+Inf/-Inf/1e999 on both bounds, bad limit/offset, and the finite control cases.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 48 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2223 · queue task 4284
Problem
GET /v1/interactionssilently dropped invalid score bounds:minScore/maxScore→ parse error swallowed → 200 with the unfiltered listNaN/Inf→ParseFloatsucceeds → bound reached SQLite as NULL → 200 with an empty listBoth directions look like real answers on the feedback-review surface.
Change (
pkgs/mcpx/internal/daemon/routes_feedback.go)400naming the parameter (invalid minScore "abc": must be a finite number). Finite bounds behave exactly as before.limit/offsetin the same handler had the same silent-drop shape → same 400 rule (triage pin from task 3372; store-neutralized today, so this is consistency, not a behavior change for valid input).Tests (
routes_feedback_test.go, realFeedbackStoreseeded 0.2/0.5/0.9)abc,NaN,Inf,+Inf,-Inf,1e999on both bounds → 400 naming the parameterlimit=abc,offset=1.5→ 400minScore=0.4→ 2;maxScore=0.4→ 1; band → 1; limit/offset paging unchangedLaptop verification:
go test ./internal/daemon/ -run TestInteractionsListpass;go test ./internal/logstore/pass; gofmt clean. Full verification is CI on this PR.Need help on this PR? Tag
@codesmith-botwith what you need.